<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>弹幕</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        p {
            position: absolute;
            top:20px;
            left: 250px;
            color: white;
        }
    </style>
</head>
<body>
    <video id="IVideo" controls="controls">
        <source src="movie.ogg">
    </video>
    <hr>
    <p id="instead"></p>
    <input type="text" id="content">
    <button id="bun">发送</button>


    <script>
        document.getElementById('bun') .onclick = function () {
            let Content = document.getElementById('content').value;
            document.getElementById('instead').textContent = Content;

            //延时器
            setTimeout( function () {
                document.getElementById('instead').textContent='';//给内容制空
            },5000)
        }
    </script>
</body>
</html>